Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items stack listing #233

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Items stack listing #233

merged 3 commits into from
Dec 20, 2024

Conversation

SeRi0uS007
Copy link
Contributor

Capability to list stacked items and math formulas to correctly display the price for such items.

"My Market Count" example
"My Market Count" example
"Sell All" example
"Sell All" example

Unfortunately, I couldn't find a good solution to fix the ugliest line to find the amount of items.

const amount = Number(unsafeWindow.g_rgAssets[appid][contextid][assetid].amount);

If we take a pure HTML string, it will cause problems with items that have a number at the beginning of the name.

@SeRi0uS007
Copy link
Contributor Author

I would also like to add that this feature has been working for me for months without any issues!

@SeRi0uS007
Copy link
Contributor Author

@Nuklon, could you please review this PR if you have time?

code.user.js Outdated Show resolved Hide resolved
code.user.js Outdated
@@ -1313,11 +1321,11 @@
const callback = () => setTimeout(() => next(), getRandomInt(1000, 1500));

if (success) {
logDOM(`${padLeft} - ${itemName} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice))}, you will receive ${formatPrice(task.sellPrice)}.`);
logDOM(`${padLeft} - ${itemName}${getAmountString(task.item.amount)} listed for ${formatPrice(market.getPriceIncludingFees(task.sellPrice) * task.item.amount)}, you will receive ${formatPrice(task.sellPrice * task.item.amount)}.`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better to have in front. In your example: 34x Hexagonana
We can probably also avoid the function, it's pretty much a one-liner, e.g. const amount = task.item.amount == 1 ? '' : task.item.amount + 'x ';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nuklon, done
image

Commit 494a094

@Nuklon Nuklon merged commit 6b8582f into Nuklon:master Dec 20, 2024
1 check passed
@SeRi0uS007 SeRi0uS007 deleted the stack-listings branch December 21, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants